#!/bin/bash
echo -e "qcom \t mode:1" 

showcommands(){
echo -e "mtk(天玑2000及以前) \t mode:2" 
echo -e "mtk(天玑2000及以后) \t mode:3" 
echo -e "mtk(天玑2000及以后2) \t mode:4" 
}

showcommands

read -p "请输入mode: " cpuid

case $cpuid in
1)
echo -e "\n\033[31m $1当前的工作模式 \033[0m " 
adb shell cat sys/class/kgsl/kgsl-3d0/devfreq/governor
echo -e "\n\033[31m $1支持的工作频率 \033[0m " 
adb shell cat sys/class/kgsl/kgsl-3d0/gpu_available_frequencies
echo -e "\n\033[31m $1GPU默认档位 \033[0m " 
adb shell cat sys/class/kgsl/kgsl-3d0/default_pwrlevel
echo -e "\n\033[31m $1当前的工作频率 \033[0m " 
adb shell cat sys/class/kgsl/kgsl-3d0/devfreq/cur_freq
echo -e "\n\033[31m $1当前的max_freq \033[0m " 
adb shell cat sys/class/kgsl/kgsl-3d0/devfreq/max_freq
echo -e "\n\033[31m $1当前的min_freq \033[0m " 
adb shell cat sys/class/kgsl/kgsl-3d0/devfreq/min_freq
echo -e "\n\033[31m $1当前的负载 \033[0m " 
adb shell cat sys/class/kgsl/kgsl-3d0/devfreq/gpu_load
    ;;


2)
echo -e "\n\033[31m $1支持的工作频率 \033[0m " 
adb shell cat /proc/gpufreq/gpufreq_opp_dump
    ;;

3)
echo -e "\n\033[31m $1支持的工作频率 \033[0m " 
adb shell "cat /proc/gpufreqv2/gpu_working_opp_table"
    ;;

4)
echo -e "\n\033[31m $1支持的工作频率 \033[0m " 
adb shell "cat /proc/gpufreqv2/stack_working_opp_table"
    ;;

esac
